package com.ablog.model;

import java.io.Serializable;

import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.ablog.annotation.Update;

/*@NotEmpty 用在集合类上面
@NotBlank 用在String上面
@NotNull  用在基本类型上*/

/**
 * (Comment)实体类
 *
 * @author mopeiwen
 * @since 2020-07-21 20:46:52
 */
public class Comment implements Serializable {
	private static final long serialVersionUID = -31417848567045489L;

	// 评论ID
	private String id;
	// 文章ID
	private String aid;
	// 评论人
	private String username;
	// 邮箱
	private String email;
	// 内容
	private String content;
	// 添加时间
	private String addtime;
	// 头像
	private String headimg;

	@NotBlank(message = "评论ID不能为空", groups = Update.class)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@NotBlank(message = "文章ID不能为空")
	public String getAid() {
		return aid;
	}

	public void setAid(String aid) {
		this.aid = aid;
	}
	
	@Length(min = 1,message = "昵称长度不能小于1位")
	@Length(max = 12,message = "昵称长度不能大于12位")
	@NotBlank(message = "昵称不能为空")
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@NotBlank(message = "邮箱不能为空")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@NotBlank(message = "评论内容不能为空")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getAddtime() {
		return addtime;
	}

	public void setAddtime(String addtime) {
		this.addtime = addtime;
	}

	@NotBlank(message = "请选择头像")
	public String getHeadimg() {
		return headimg;
	}

	public void setHeadimg(String headimg) {
		this.headimg = headimg;
	}

}